package com.hk.core.authentication.api.validatecode.sms;

import com.hk.core.authentication.api.validatecode.ValidateCode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @author Kevin
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class SmsValidateCode extends ValidateCode {

    private final String phone;

    public SmsValidateCode(String phone) {
        this.phone = phone;
    }

    public SmsValidateCode(String phone, String id) {
        this.phone = phone;
        setId(id);
    }

    public SmsValidateCode(String phone, String code, int expireSecond) {
        super(code, expireSecond);
        this.phone = phone;
    }

    @Override
    public SmsValidateCode setId(String id) {
        return (SmsValidateCode) super.setId(id);
    }

    @Override
    public SmsValidateCode setCode(String code) {
        return (SmsValidateCode) super.setCode(code);
    }

    @Override
    public SmsValidateCode setExpireSecond(int expireSecond) {
        return (SmsValidateCode) super.setExpireSecond(expireSecond);
    }
}
